<template>
  <div>
    <div class="interview-list">
      <el-row :gutter="12">
        <el-col v-for="item in interviewList" :span="8">
          <a :href="item.interviewurl" target="_blank">
            <el-card shadow="hover" class="card-item">
               <img :src="item.imgurl">
              <div class="title-mask">
                <div class="title">{{item.title.length<=20?item.title:item.title.substring(0, 10)+"..." }}</div>
                <div class="des">
                  {{item.des}}
                </div>
              </div>
            </el-card>
          </a>
        </el-col>
      </el-row>
    </div>
    <div class="pagination">
      <el-pagination
          @current-change="handleCurrentChange"
          :page-size="PageData.pageSize"
          layout="prev, pager, next, jumper"
          :total="PageData.total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import {getInterview} from "@/plugins/api";

export default {
  name: "Interview",
  data(){
    return {
      interviewList:[
      ],
      PageData: {
        pageNo:1,
        pageSize:3,
        total:100
      }
    }
  },
  computed:{
  },
  methods:{
    getInterviewData(){
      var urlSearchParams = new URLSearchParams();
      urlSearchParams.set("pageNo", this.PageData.pageNo)
      urlSearchParams.set("pageSize", this.PageData.pageSize)
      let _this = this
      getInterview(urlSearchParams).then(function (msg) {
        _this.interviewList = msg.data.pageList.records;
        _this.PageData.total = msg.data.pageList.total
      })
    },
    handleCurrentChange(val){
      this.PageData.pageNo = val
      this.getInterviewData()
    }
  },
  created() {
    this.getInterviewData()
  }
}
</script>

<style scoped>
.interview-list{
  margin:0 20px;
}
/deep/.el-card__body {
  padding: 0px;
}
.card-item{
  margin: 20px 25px;
  padding: 0;
  position: relative;
  text-align: center;
  height:560px;
}
img{
  width: 100%;
  height:auto;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

.title-mask{
  background:url(../assets/slide-mask.png) no-repeat center top;
  height: 95px;
  width: 100%;
  position:absolute;
  bottom:30px;
  left:0;
  text-align: center;
}
.title-mask .title{
  font-size: 25px;
  color:white;
  line-height: 50px;
  text-shadow: 0px 1px 3px #000;
}
.title-mask .des{
  color: white;
  font-size: 14px;
}

.card-item:hover{
  color: #99a9bf;
  opacity: 0.7;
  cursor: pointer;
}
.img-group el-image{
  width: 100%;
  height: 100%;
}
.pagination{
  margin: 30px;
  text-align: center;
}
</style>